package com.jlf.core.annotation.filter;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 输入参数过滤声明注解
 *
 * @author wujr
 * 2021/1/13
 * @version 1.0
 * 变更历史
 * [wujr 2021/1/13 1.0 新增]
 */
@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Repeatable(ParameterFilter.List.class)
public @interface ParameterFilter {
    String name() default "";

    Class<? extends FilterProcessor<?>> processor();

    int order() default 1;

    /**
     * Defines several {@code @InputFilter} constraints on the same element.
     *
     * @see ParameterFilter
     */
    @Target({ FIELD, ANNOTATION_TYPE })
    @Retention(RUNTIME)
    @Documented
    @Inherited
    @interface List {
        ParameterFilter[] value();
    }
}
